#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int arr[10], m,count=0;
	for (int i = 0; i < 10; i++)
	{
		scanf("%d", &arr[i]);
	}
	scanf("%d", &m);
	for (int i = 0; i < 10; i++)
	{
		if (m+30>=arr[i])
		{
			count++;
		}
		
	}
	printf("%d", count);
}